package cn.q3c.web.tool.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.springframework.stereotype.Service;

import cn.q3c.web.tool.object.Match;

@Service
public class MatchDAO extends BaseDAO{

	public List<Match> getMatchList(String matchtype) throws SQLException {

		Connection conn = dataSource.getConnection();

		String sql = "select * from t_matchs where matchtype=?";

		List<Match> result = null;
		try {

			Object[] objs = new Object[] { matchtype };

			result = (List<Match>) this.query(conn, sql,
					new BeanListHandler<Match>(Match.class), objs);

		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			DbUtils.close(conn);
		}

		return result;
	}
}